﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Web;

namespace Media.Hepler
{
    public class TN_CMSMediaConfig
    {
        public static string GetSettingByKey(string key)
        {
            try
            {
                var _configMap = new ExeConfigurationFileMap();
                _configMap.ExeConfigFilename = HttpContext.Current.Server.MapPath("/") + "TN_CMS.Media.config";
                var _config = ConfigurationManager.OpenMappedExeConfiguration(_configMap, ConfigurationUserLevel.None);

                return _config.AppSettings.Settings[key].Value;
            }
            catch (Exception ex)
            {
                return null;
            }
        }
    }
}